<template>
  <div class="container">
    获取查看客户详情的id：{{ this.$route.query.id }}
  </div>
</template>

<script>
import { getCustomer } from '@/api/clients'
export default {
  name: 'DetailClient',
  data() {
    return {
      id: this.$route.query.id, // 拿到客户管理中点击查看详情传来的id
      loadind: false,
      selectData: {}
    }
  },
  created() {
    this.fetchData() // 获取对应id传来的客户详情
  },
  methods: {
    fetchData() {
      const para = {
        id: this.id
      }
      getCustomer(para).then((res) => {
        this.loadind = true
        this.selectData = res.data
      })
      this.loadind = false
    }
  }
}
</script>
